-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create project #2595
Create project #2595
Conversation
flyingrabbit-lab
commented
Sep 21, 2023
- Create project api
- Refactor http endpoints to get project api key
- Refactor services to have base class
- Refactor services to use generic handler
Deploying with Cloudflare Pages
|
5bb4525
to
1db03c8
Compare
5434fb2
to
d096b3b
Compare
Fixes Fixes Fixes Fixes Fixes Fixes Fixes Fixes
d096b3b
to
c411af9
Compare
Fixes Fixes Fixes Fixes Fixes Fixes Fixes Fixes Fixes
c411af9
to
a1d091f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Where do you require Project ID the get requests?
- Aren't we missing API Key Controller for the project?
/** | ||
* Project Guardian subcollection. | ||
*/ | ||
export interface ProjectGuardian extends BaseSubCollection { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call them Project Admin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
|
||
batch.create(projectDocRef, project); | ||
|
||
const guardianDocRef = projectDocRef.collection(SUB_COL.GUARDIANS).doc(GUARDIAN_ID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call them project admin's. It's confusing to call them guardians.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
const projectDocRef = build5Db().doc(`${COL.PROJECT}/${projectData.uid}`); | ||
batch.create(projectDocRef, projectData); | ||
|
||
const guardianDocRef = projectDocRef.collection(SUB_COL.GUARDIANS).doc(owner); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again let's call them admin please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
export const voteControl = async (owner: string, params: VoteRequest) => { | ||
const hasStakedSoons = await hasStakedSoonTokens(owner); | ||
export const voteControl = async ({ project, owner }: Context, params: VoteRequest) => { | ||
const hasStakedSoons = await hasStakedTokens(project, owner); | ||
if (!hasStakedSoons) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't the "hasStakedSoons" only apply when project billing is ProjectBilling.TOKEN_BASE. How come this was not picked by a test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hasStakedSoons returns true if project billing is not TOKEN_BASED
packages/functions/src/index.ts
Outdated
exports[WEN_FUNC.deactivateProject] = deactivateProject; | ||
|
||
// TODO Remove this after release | ||
exports['init_soon_project'] = initSoonProject; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope we can eventually have better process for this instead of subsequent commit to update code and release new version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually it is possible, I have moved it to DB rolls
.description( | ||
`Discounts for this project. Set only if billing type is ${ProjectBilling.TOKEN_BASE}`, | ||
), | ||
baseTokenSymbol: Joi.string() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not call it "base..." this confuses the naming convention of whats considered on Shimmer as base token (ie. SMR). You could call it nativeToken if you like.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
decodeAuth gets the project id from the project api token. |
make sense, i think my question is also regarding GET Api requests. Ie. getManyById, GetbyId, etc.. when they read data they have to provide api key to get access |
3c02cb3
to
9784677
Compare
9784677
to
2cf389d
Compare
Yes, I think I wrote this earlier, currently project api key is turned off, not required. Next steps is to update the get requests and do validation in the post requests |